home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!olivea!oliveb!veritas!amdcad!sun!exodus!bea.lbl.gov
- From: envbvs@bea.lbl.gov (Brian V. Smith)
- Newsgroups: comp.sources.x
- Subject: v13i068: xfig2, Patch10, Part01/04
- Message-ID: <16331@exodus.Eng.Sun.COM>
- Date: 6 Jul 91 06:59:07 GMT
- References: <csx-13i068-xfig2.9@uunet.UU.NET>
- Sender: news@exodus.Eng.Sun.COM
- Lines: 1827
- Approved: argv@sun.com
-
- Submitted-by: envbvs@bea.lbl.gov (Brian V. Smith)
- Posting-number: Volume 13, Issue 68
- Archive-name: xfig2.9/patch10.01
- Patch-To: xfig2.9: Volume 8, Issue 10-30
- Patch-To: xfig2.9: Volume 10, Issue 26-31
-
- Patchlevel 10
- Changes from patchlevel 9:
-
- o zooming and panning is now possible for all objects except texts.
- Use new buttons, arrow keys for panning. See the man page.
- From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
- o selecting one of several overlapping objects is implemented for
- most functions.
- Hold down Shift key while clicking on object to cycle through
- candidate objects, release shift key for selection. See man page.
- From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
- o dash length and dot gap width can be modified using the Change menu
- From Dieter Pellkofer (dip@regent.e-technik.tu-muenchen.de)
- o dash length scaled to line width and zoom factor
- From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
- o multiple Grid Sizes
- Two grids are available in the -metric mode
- From Dieter Pellkofer (dip@regent.e-technik.tu-muenchen.de)
- o open polygons and splines can be filled
- From Dieter Pellkofer (dip@regent.e-technik.tu-muenchen.de)
- o new resource 'Startfontsize' and command line option -startfontsize
- From Georg Sigl (ges@regent.e-technik.tu-muenchen.de)
- o point markers displayed with text objects
- From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
- o grid and ruler bitmaps are created dynamically
- This was neccessary for the zoom and pan commands
- From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
- o changing text by clicking on it has to be finished with the left
- button. Finishing with the middle button is no longer possible
- (this is rather a workaround for the bug that gave interesting
- effects)
- From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
- o if a point is to be deleted from a line, at least 2 points must remain
- From Dieter Pellkofer (dip@regent.e-technik.tu-muenchen.de)
- o fixed bug where finishing text with middle button, saving figure
- and trying to quit made xfig claim the figure hadn't been saved
- o fixed bug where line of zero length with an arrow head would cause f2ps
- to divide by zero
- o there is a bug in OpenWindows which causes xfig to crash when trying to
- create the pixmaps from one-plane bitmaps for the button icons. According
- to the Intrinsics manual, the XtNbitmap resource in a widget will auto-
- matically be converted to the proper screen depth, but OpenWindows seems
- not to do this. Add the define "-DOPENWIN" to the "DEFINES" line
- in the Imakefile if you are running OpenWindows.
- o depth of objects is now honored - set object depth with popup change window
- From Mike Lutz <mjl@cs.rit.edu>
- o bug fixed where "create object -> read file -> undo" would delete objects
- Tom Tkacik (tkacik@hobbes.cs.gmr.com)
- o creation of text is now undoable
- o text inside compound is erased properly when compound is moved/deleted etc
- o f2ps now uses the -s (font size) option when objects are defined
- with default font size (-1)
- From Ian Dall <idall@augean.ua.oz.au>
- o font spacing button value no longer crashes xfig on MIPS type machine
- o having spline where two or more points are coincident no longer
- gives DOMAIN error or crashes xfig
- From Mike Lawley <lawley@muse.cs.mu.oz.au>
- o attempting to draw arc with two or more coincident points no longer
- crashes xfig
- o definition of errno, sys_nerr and sys_errlist moved to fig.h
- From Casey Leedem <casey@gauss.llnl.gov>
- o removed startup message printing to stdout
-
- ---------------------------------------------------------------------
- --- Part 1 of 4 follows.
- ---
- --- After unpacking all four parts by following the instructions in
- --- each file, for each resulting file type 'patch -p < patch10.x',
- --- where 'x' is the number of the patch file (1 through 4).
- ---------------------------------------------------------------------
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 1 (of 4)."
- # Contents: patch10.2
- # Wrapped by envbvs@bea.lbl.gov.lbl.gov on Fri Jun 14 14:37:00 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'patch10.2' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'patch10.2'\"
- else
- echo shar: Extracting \"'patch10.2'\" \(48592 characters\)
- sed "s/^X//" >'patch10.2' <<'END_OF_FILE'
- X*** @xfig.pl9/deletept.c Tue May 1 16:33:49 1990
- X--- ./deletept.c Mon Jun 3 11:13:28 1991
- X***************
- X*** 13,19 ****
- X #include "object.h"
- X #include "paintop.h"
- X
- X- #define TOLERANCE 3
- X
- X extern (*canvas_kbd_proc)();
- X extern (*canvas_locmove_proc)();
- X--- 13,18 ----
- X***************
- X*** 34,46 ****
- X extern F_line *line;
- X extern F_spline *spline;
- X
- X! extern int init_delete_point();
- X
- X delete_point_selected()
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! canvas_leftbut_proc = init_delete_point;
- X canvas_middlebut_proc = null_proc;
- X canvas_rightbut_proc = set_popupmenu;
- X set_cursor(&pick9_cursor);
- X--- 33,47 ----
- X extern F_line *line;
- X extern F_spline *spline;
- X
- X! extern point_search();
- X! int init_delete_point();
- X
- X delete_point_selected()
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! init_point_search(init_delete_point);
- X! canvas_leftbut_proc = point_search;
- X canvas_middlebut_proc = null_proc;
- X canvas_rightbut_proc = set_popupmenu;
- X set_cursor(&pick9_cursor);
- X***************
- X*** 47,67 ****
- X reset_action_on();
- X }
- X
- X! init_delete_point(x, y)
- X! int x, y;
- X {
- X F_spline *spline;
- X F_line *line;
- X- F_point *p, *q;
- X int n;
- X
- X /*
- X! If the attemp to delete point fails, we wouldn't want any important
- X! variables (left_point, right_point and delted_point) to change.
- X! So we used p and q in the search.
- X */
- X
- X! if ((line = line_point_search(x, y, TOLERANCE, &p, &q)) != NULL) {
- X if (line->type == T_BOX || line->type == T_ARC_BOX) {
- X put_msg("Deleting box corners is not allowed");
- X return;
- X--- 48,71 ----
- X reset_action_on();
- X }
- X
- X! init_delete_point(obj, type, x, y, p, q)
- X! char *obj;
- X! int type, x, y;
- X! F_point *p,*q;
- X {
- X F_spline *spline;
- X F_line *line;
- X int n;
- X
- X /*
- X! If the attemp to delete point fails, we wouldn't want any
- X! important variables (left_point, right_point and delted_point)
- X! to change. So we used p and q in the search.
- X */
- X
- X! switch (type)
- X! { case O_POLYLINE:
- X! line= (F_line *) obj;
- X if (line->type == T_BOX || line->type == T_ARC_BOX) {
- X put_msg("Deleting box corners is not allowed");
- X return;
- X***************
- X*** 73,79 ****
- X return;
- X }
- X }
- X! else if (n <= 1) {
- X put_msg("A line cannot have less than 2 points");
- X return;
- X }
- X--- 77,83 ----
- X return;
- X }
- X }
- X! else if (n <= 2) { /* changed this from 2 to 1 - hns */
- X put_msg("A line cannot have less than 2 points");
- X return;
- X }
- X***************
- X*** 84,91 ****
- X linepoint_deleting(line);
- X set_action_object(F_DELETE_POINT, O_POLYLINE);
- X set_latestline(line);
- X! }
- X! else if ((spline=spline_point_search(x, y, TOLERANCE, &p, &q)) != NULL){
- X n = num_points(spline->points);
- X if (closed_spline(spline)) {
- X if (n <= 4) {
- X--- 88,97 ----
- X linepoint_deleting(line);
- X set_action_object(F_DELETE_POINT, O_POLYLINE);
- X set_latestline(line);
- X! break;
- X!
- X! case O_SPLINE:
- X! spline= (F_spline *) obj;
- X n = num_points(spline->points);
- X if (closed_spline(spline)) {
- X if (n <= 4) {
- X***************
- X*** 110,117 ****
- X splinepoint_deleting(spline);
- X set_action_object(F_DELETE_POINT, O_SPLINE);
- X set_latestspline(spline);
- X! }
- X }
- X
- X /************************** spline *******************************/
- X
- X--- 116,124 ----
- X splinepoint_deleting(spline);
- X set_action_object(F_DELETE_POINT, O_SPLINE);
- X set_latestspline(spline);
- X! break;
- X }
- X+ }
- X
- X /************************** spline *******************************/
- X
- X*** @xfig.pl9/dir.c Fri Apr 27 10:29:30 1990
- X--- ./dir.c Mon Jun 3 13:25:16 1991
- X***************
- X*** 9,17 ****
- X */
- X #include "fig.h"
- X
- X- extern char *sys_errlist[];
- X- extern int sys_nerr, errno;
- X-
- X extern char directory[];
- X
- X int
- X--- 9,14 ----
- X*** @xfig.pl9/drag.c Mon Apr 30 12:13:08 1990
- X--- ./drag.c Mon Jun 3 11:13:34 1991
- X***************
- X*** 144,152 ****
- X dx = cur_x - fix_x;
- X dy = cur_y - fix_y;
- X pw_vector(canvas_win, a->point[0].x+dx, a->point[0].y+dy,
- X! a->point[1].x+dx, a->point[1].y+dy, op, 1, SOLID_LINE, 0.0);
- X pw_vector(canvas_win, a->point[1].x+dx, a->point[1].y+dy,
- X! a->point[2].x+dx, a->point[2].y+dy, op, 1, SOLID_LINE, 0.0);
- X }
- X
- X /************************* line section **********************/
- X--- 144,152 ----
- X dx = cur_x - fix_x;
- X dy = cur_y - fix_y;
- X pw_vector(canvas_win, a->point[0].x+dx, a->point[0].y+dy,
- X! a->point[1].x+dx, a->point[1].y+dy, op, 1, RUBBER_LINE, 0.0);
- X pw_vector(canvas_win, a->point[1].x+dx, a->point[1].y+dy,
- X! a->point[2].x+dx, a->point[2].y+dy, op, 1, RUBBER_LINE, 0.0);
- X }
- X
- X /************************* line section **********************/
- X***************
- X*** 200,206 ****
- X y = p->y + dy;
- X for (p = p->next; p != NULL; x = xx, y = yy, p = p->next) {
- X xx = p->x + dx; yy = p->y +dy;
- X! pw_vector(canvas_win, x, y, xx, yy, op, 1, SOLID_LINE, 0.0);
- X }
- X }
- X
- X--- 200,206 ----
- X y = p->y + dy;
- X for (p = p->next; p != NULL; x = xx, y = yy, p = p->next) {
- X xx = p->x + dx; yy = p->y +dy;
- X! pw_vector(canvas_win, x, y, xx, yy, op, 1, RUBBER_LINE, 0.0);
- X }
- X }
- X
- X***************
- X*** 221,229 ****
- X {
- X txsize = pf_textwidth(t->font, t->size, strlen(t->cstring), t->cstring);
- X if (t->type == T_CENTER_JUSTIFIED)
- X! x1off = - txsize.x/2;
- X else
- X! x1off = - txsize.x;
- X fix_x = t->base_x;
- X }
- X else /* LEFT */
- X--- 221,229 ----
- X {
- X txsize = pf_textwidth(t->font, t->size, strlen(t->cstring), t->cstring);
- X if (t->type == T_CENTER_JUSTIFIED)
- X! x1off = - txsize.x/2/zoomscale;
- X else
- X! x1off = - txsize.x/zoomscale;
- X fix_x = t->base_x;
- X }
- X else /* LEFT */
- X***************
- X*** 256,261 ****
- X--- 256,262 ----
- X last_position.y = fix_y;
- X translate_text(text, x - fix_x, y - fix_y);
- X draw_text(text, PAINT);
- X+ show_pointmarker();
- X set_modifiedflag();
- X (*return_proc)();
- X }
- X*** @xfig.pl9/draw.c Mon Apr 16 11:24:55 1990
- X--- ./draw.c Thu Jun 13 10:08:26 1991
- X***************
- X*** 10,15 ****
- X--- 10,16 ----
- X #include "resources.h"
- X #include "object.h"
- X #include "paintop.h"
- X+ #include "zoom.h"
- X
- X extern int pointmarker_shown, compoundbox_shown;
- X extern int background_color, foreground_color;
- X***************
- X*** 88,94 ****
- X F_text *t;
- X
- X for (t = texts; t != NULL; t = t->next) {
- X! draw_text(t, INV_PAINT);
- X };
- X }
- X
- X--- 89,95 ----
- X F_text *t;
- X
- X for (t = texts; t != NULL; t = t->next) {
- X! draw_text(t, ERASE);
- X };
- X }
- X
- X***************
- X*** 284,331 ****
- X x = point->x;
- X y = point->y;
- X if (line->points->next == NULL) { /* A single point */
- X! XDrawPoint(tool_d, canvas_win, gccache[op], x, y);
- X return;
- X }
- X if (line->back_arrow) /* backward arrow */
- X draw_arrow(point->next->x, point->next->y, x, y,
- X line->back_arrow, op);
- X! if (line->style == SOLID_LINE) /* accumulate the points for solid line */
- X {
- X! npoints = 0;
- X! /* count number of points in this object */
- X! for ( ; point != NULL; point = point->next)
- X! npoints++;
- X! /* accumulate the points in an array */
- X! if ((points = (XPoint *) malloc(npoints*sizeof(XPoint))) == 0)
- X! {
- X! fprintf(stderr,"draw_line(): No memory\n");
- X! return;
- X! }
- X! pptr = points;
- X }
- X! for (point=line->points; point != NULL; point = point->next) {
- X! if (line->style == SOLID_LINE)
- X! {
- X! pptr->x = point->x;
- X! pptr->y = point->y;
- X! pptr++;
- X! }
- X! else /* draw dashed or dotted line segment by segment
- X! otherwise when moving one segment later there
- X! is an alignment problem with the dashes */
- X! pw_vector(canvas_win, x, y, point->x, point->y, op,
- X! line->thickness, line->style, line->style_val);
- X xx = x; yy = y;
- X x = point->x;
- X y = point->y;
- X }
- X! if (line->style == SOLID_LINE)
- X! {
- X! pw_lines(canvas_win, points, npoints, op,
- X line->thickness, line->style, line->style_val, 0);
- X! free(points);
- X! }
- X if (line->for_arrow)
- X draw_arrow(xx, yy, x, y, line->for_arrow, op);
- X }
- X--- 285,319 ----
- X x = point->x;
- X y = point->y;
- X if (line->points->next == NULL) { /* A single point */
- X! zXDrawPoint(tool_d, canvas_win, gccache[op], x, y);
- X return;
- X }
- X if (line->back_arrow) /* backward arrow */
- X draw_arrow(point->next->x, point->next->y, x, y,
- X line->back_arrow, op);
- X! npoints = 0;
- X! /* count number of points in this object */
- X! for ( ; point != NULL; point = point->next)
- X! npoints++;
- X! /* accumulate the points in an array */
- X! if ((points = (XPoint *) malloc(npoints*sizeof(XPoint))) == 0)
- X {
- X! fprintf(stderr,"draw_line(): No memory\n");
- X! return;
- X }
- X! pptr = points;
- X! for (point=line->points; point != NULL; point = point->next)
- X! {
- X! pptr->x = point->x;
- X! pptr->y = point->y;
- X! pptr++;
- X xx = x; yy = y;
- X x = point->x;
- X y = point->y;
- X }
- X! pw_lines(canvas_win, points, npoints, op,
- X line->thickness, line->style, line->style_val, 0);
- X! free(points);
- X if (line->for_arrow)
- X draw_arrow(xx, yy, x, y, line->for_arrow, op);
- X }
- X***************
- X*** 366,381 ****
- X set_line_stuff(thick,style,val,op);
- X gc = gccache[op];
- X diam = 2*radius;
- X! XDrawArc(tool_d, canvas_win, gc, xmin, ymin,
- X diam, diam, 90*64, 90*64);
- X! XDrawLine(tool_d, canvas_win, gc, xmin, ymin+radius, xmin, ymax-radius+1);
- X! XDrawArc(tool_d, canvas_win, gc, xmin, ymax-diam,
- X diam, diam, 180*64, 90*64);
- X! XDrawLine(tool_d, canvas_win, gc, xmin+radius, ymax, xmax-radius+1, ymax);
- X! XDrawArc(tool_d, canvas_win, gc, xmax-diam, ymax-diam,
- X diam, diam, 270*64, 90*64);
- X! XDrawLine(tool_d, canvas_win, gc, xmax, ymax-radius, xmax, ymin+radius-1);
- X! XDrawArc(tool_d, canvas_win, gc, xmax-diam, ymin,
- X diam, diam, 0*64, 90*64);
- X! XDrawLine(tool_d, canvas_win, gc, xmax-radius, ymin, xmin+radius-1, ymin);
- X }
- X--- 354,369 ----
- X set_line_stuff(thick,style,val,op);
- X gc = gccache[op];
- X diam = 2*radius;
- X! zXDrawArc(tool_d, canvas_win, gc, xmin, ymin,
- X diam, diam, 90*64, 90*64);
- X! zXDrawLine(tool_d, canvas_win, gc, xmin, ymin+radius, xmin, ymax-radius+1);
- X! zXDrawArc(tool_d, canvas_win, gc, xmin, ymax-diam,
- X diam, diam, 180*64, 90*64);
- X! zXDrawLine(tool_d, canvas_win, gc, xmin+radius, ymax, xmax-radius+1, ymax);
- X! zXDrawArc(tool_d, canvas_win, gc, xmax-diam, ymax-diam,
- X diam, diam, 270*64, 90*64);
- X! zXDrawLine(tool_d, canvas_win, gc, xmax, ymax-radius, xmax, ymin+radius-1);
- X! zXDrawArc(tool_d, canvas_win, gc, xmax-diam, ymin,
- X diam, diam, 0*64, 90*64);
- X! zXDrawLine(tool_d, canvas_win, gc, xmax-radius, ymin, xmin+radius-1, ymin);
- X }
- X*** @xfig.pl9/ellipse.c Thu May 3 11:58:28 1990
- X--- ./ellipse.c Mon Jun 3 11:13:50 1991
- X***************
- X*** 50,57 ****
- X center_marker(x, y)
- X int x, y;
- X {
- X! pw_vector(canvas_win, x, y-2, x, y+2, INV_PAINT, 1, SOLID_LINE, 0.0);
- X! pw_vector(canvas_win, x-2, y, x+2, y, INV_PAINT, 1, SOLID_LINE, 0.0);
- X }
- X
- X ellipsebyradius_drawing_selected()
- X--- 50,57 ----
- X center_marker(x, y)
- X int x, y;
- X {
- X! pw_vector(canvas_win, x, y-2, x, y+2, INV_PAINT, 1, RUBBER_LINE, 0.0);
- X! pw_vector(canvas_win, x-2, y, x+2, y, INV_PAINT, 1, RUBBER_LINE, 0.0);
- X }
- X
- X ellipsebyradius_drawing_selected()
- X***************
- X*** 118,124 ****
- X ellipse->type = T_ELLIPSE_BY_RAD;
- X ellipse->style = line_style;
- X ellipse->thickness = line_thickness;
- X! ellipse->style_val = cur_styleval;
- X ellipse->angle = cur_angle;
- X ellipse->color = cur_color;
- X ellipse->depth = 0;
- X--- 118,124 ----
- X ellipse->type = T_ELLIPSE_BY_RAD;
- X ellipse->style = line_style;
- X ellipse->thickness = line_thickness;
- X! ellipse->style_val = cur_styleval*(line_thickness+1)/2;
- X ellipse->angle = cur_angle;
- X ellipse->color = cur_color;
- X ellipse->depth = 0;
- X***************
- X*** 198,204 ****
- X ellipse->type = T_ELLIPSE_BY_DIA;
- X ellipse->style = line_style;
- X ellipse->thickness = line_thickness;
- X! ellipse->style_val = cur_styleval;
- X ellipse->angle = cur_angle;
- X ellipse->color = cur_color;
- X ellipse->depth = 0;
- X--- 198,204 ----
- X ellipse->type = T_ELLIPSE_BY_DIA;
- X ellipse->style = line_style;
- X ellipse->thickness = line_thickness;
- X! ellipse->style_val = cur_styleval*(line_thickness+1)/2;
- X ellipse->angle = cur_angle;
- X ellipse->color = cur_color;
- X ellipse->depth = 0;
- X***************
- X*** 274,280 ****
- X y1 = fix_y + radius;
- X y2 = fix_y - radius;
- X draw_rectbox(x1, y1, x2, y2, op);
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
- X }
- X
- X create_circlebyrad(x, y)
- X--- 274,280 ----
- X y1 = fix_y + radius;
- X y2 = fix_y - radius;
- X draw_rectbox(x1, y1, x2, y2, op);
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, op, 1, RUBBER_LINE, 0.0);
- X }
- X
- X create_circlebyrad(x, y)
- X***************
- X*** 293,299 ****
- X c->type = T_CIRCLE_BY_RAD;
- X c->style = line_style;
- X c->thickness = line_thickness;
- X! c->style_val = cur_styleval;
- X c->angle = 0.0;
- X c->color = cur_color;
- X c->depth = 0;
- X--- 293,299 ----
- X c->type = T_CIRCLE_BY_RAD;
- X c->style = line_style;
- X c->thickness = line_thickness;
- X! c->style_val = cur_styleval*(line_thickness+1)/2;
- X c->angle = 0.0;
- X c->color = cur_color;
- X c->depth = 0;
- X***************
- X*** 367,373 ****
- X y1 = fix_y + ry + radius;
- X y2 = fix_y + ry - radius;
- X draw_rectbox(x1, y1, x2, y2, op);
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
- X }
- X
- X create_circlebydia(x, y)
- X--- 367,373 ----
- X y1 = fix_y + ry + radius;
- X y2 = fix_y + ry - radius;
- X draw_rectbox(x1, y1, x2, y2, op);
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, op, 1, RUBBER_LINE, 0.0);
- X }
- X
- X create_circlebydia(x, y)
- X***************
- X*** 386,392 ****
- X c->type = T_CIRCLE_BY_DIA;
- X c->style = line_style;
- X c->thickness = line_thickness;
- X! c->style_val = cur_styleval;
- X c->angle = 0.0;
- X c->color = cur_color;
- X c->depth = 0;
- X--- 386,392 ----
- X c->type = T_CIRCLE_BY_DIA;
- X c->style = line_style;
- X c->thickness = line_thickness;
- X! c->style_val = cur_styleval*(line_thickness+1)/2;
- X c->angle = 0.0;
- X c->color = cur_color;
- X c->depth = 0;
- X*** @xfig.pl9/f2ps.c Wed Aug 1 13:24:30 1990
- X--- ./f2ps.c Mon Jun 3 13:25:16 1991
- X***************
- X*** 26,31 ****
- X--- 26,32 ----
- X char *prog;
- X char *font = DEFAULT_FONT;
- X int font_size = DEFAULT_FONT_SIZE;
- X+ int font_number = 0;
- X int cur_thickness;
- X int cur_areafill=0;
- X int show_page = 1;
- X***************
- X*** 110,118 ****
- X--- 111,127 ----
- X {
- X F_compound objects;
- X int status;
- X+ int i;
- X
- X get_args(argc, argv);
- X
- X+ for (i = 0; i < NUMFONTS; i++)
- X+ if (strcmp(font, fontnames[i].psfont) == 0)
- X+ {
- X+ font_number = i;
- X+ break;
- X+ }
- X+
- X if (to == NULL)
- X tfp = stdout;
- X else if ((tfp = fopen(to, "w")) == NULL) {
- X***************
- X*** 409,415 ****
- X return;
- X }
- X if (l->back_arrow)
- X! draw_arrow_head((float)q->x, (float)q->y, (float)p->x,
- X (float)p->y, l->back_arrow->ht, l->back_arrow->wid);
- X set_style(l->style, l->style_val);
- X fprintf(tfp, "%% Polyline\n");
- X--- 418,424 ----
- X return;
- X }
- X if (l->back_arrow)
- X! draw_arrow_head((float)q->x, (float)q->y, (float)p->x,
- X (float)p->y, l->back_arrow->ht, l->back_arrow->wid);
- X set_style(l->style, l->style_val);
- X fprintf(tfp, "%% Polyline\n");
- X***************
- X*** 657,662 ****
- X--- 666,674 ----
- X for (j=0; j<MAX_FONT_SIZES; j++)
- X first[i][j] = 0;
- X
- X+ if (t->font == -1) t->font = font_number;
- X+ if (t->size == -1) t->size = font_size;
- X+
- X /* if different font or different size, choose new */
- X if (current_font != t->font || current_size != t->size)
- X {
- X***************
- X*** 782,788 ****
- X
- X dx = x2 - x1; dy = y1 - y2;
- X l = sqrt((double)(dx*dx + dy*dy)); /* length of line */
- X! sina = dy / l; cosa = dx / l;
- X xb = x2*cosa - y2*sina;
- X yb = x2*sina + y2*cosa;
- X x = xb - arrowht;
- X--- 794,806 ----
- X
- X dx = x2 - x1; dy = y1 - y2;
- X l = sqrt((double)(dx*dx + dy*dy)); /* length of line */
- X! if (l == 0) /* uh-oh, zero-length line */
- X! return;
- X! else
- X! {
- X! sina = dy / l;
- X! cosa = dx / l;
- X! }
- X xb = x2*cosa - y2*sina;
- X yb = x2*sina + y2*cosa;
- X x = xb - arrowht;
- X*** @xfig.pl9/fig.h Thu Aug 2 11:20:25 1990
- X--- ./fig.h Mon Jun 3 10:56:14 1991
- X***************
- X*** 19,24 ****
- X--- 19,29 ----
- X #include <stdio.h>
- X #include <ctype.h>
- X #include <errno.h>
- X+
- X+ extern int errno;
- X+ extern int sys_nerr;
- X+ extern char *sys_errlist[];
- X+
- X #include <math.h>
- X
- X #ifdef SYSV
- X*** @xfig.pl9/font.c Thu Jul 5 09:50:39 1990
- X--- ./font.c Mon Jun 3 13:25:16 1991
- X***************
- X*** 54,59 ****
- X--- 54,63 ----
- X gc_fontsize[i] = 0;
- X }
- X
- X+ /* OpenWindows can make any of the LaserWriter fonts at any size so this next code is
- X+ not necessary for OpenWindows */
- X+
- X+ #ifndef OPENWIN
- X /* Now initialize the font structure for the X fonts corresponding
- X to the Postscript fonts for the canvas */
- X
- X***************
- X*** 70,76 ****
- X flist[p].fn = *fname++; /* save name of this size font */
- X flist[p++].s = ss; /* and save size */
- X }
- X! for (ss=4; ss<=40; ss++)
- X {
- X for (i=0; i<p; i++)
- X if (flist[i].s == ss)
- X--- 74,80 ----
- X flist[p].fn = *fname++; /* save name of this size font */
- X flist[p++].s = ss; /* and save size */
- X }
- X! for (ss=4; ss<=50; ss++) /* 40 substituted by 50 by ges */
- X {
- X for (i=0; i<p; i++)
- X if (flist[i].s == ss)
- X***************
- X*** 92,97 ****
- X--- 96,102 ----
- X }
- X }
- X } /* next font, f */
- X+ #endif /* OPENWIN */
- X }
- X
- X /* parse the point size of font 'name' */
- X***************
- X*** 126,136 ****
- X--- 131,154 ----
- X {
- X struct xfont *xf;
- X XFontStruct *fontst;
- X+ char fn[128];
- X
- X if (f<0) /* use font 0 for default font (-1) */
- X f=0;
- X if (s<0)
- X s=DEF_PRINTFONTSIZE; /* default font size */
- X+
- X+ #ifdef OPENWIN
- X+ sprintf (fn, "%s-%d", fontnames[f].psfont, s);
- X+ lower(fn);
- X+ if (appres.DEBUG)
- X+ fprintf(stderr,"Loading font %s\n",fn);
- X+ fontst = XLoadQueryFont(tool_d, fn);
- X+ if (fontst == NULL)
- X+ fprintf(stderr,"What!!?!?! Can't find font %s\n",fn);
- X+ return fontst;
- X+
- X+ #else /* !OPENWIN */
- X xf = fontnames[f].xfontlist; /* go through the linked list looking for match */
- X if (xf == NULL)
- X return roman_font; /* use a default font */
- X***************
- X*** 156,159 ****
- X--- 174,178 ----
- X fprintf(stderr,"What!!?!?! Can't find font %s\n",xf->fname);
- X }
- X return xf->fstruct;
- X+ #endif /* !OPENWIN */
- X }
- X*** @xfig.pl9/func.h Thu Sep 20 16:27:46 1990
- X--- ./func.h Mon Jun 3 11:16:30 1991
- X***************
- X*** 99,102 ****
- X--- 99,105 ----
- X #define F_LATEX_LINE 280 /*fs*/
- X #define F_LATEX_ARROW 281 /*fs*/
- X
- X+ #define F_ZOOM 290
- X+ #define F_PAN 291
- X+
- X #define F_NOP 999
- X*** @xfig.pl9/geom.c Tue Jan 16 17:21:06 1990
- X--- ./geom.c Mon Jun 3 13:25:16 1991
- X***************
- X*** 126,131 ****
- X--- 126,133 ----
- X
- X dx12 = p1.x - p2.x; dy12 = p1.y - p2.y;
- X dx13 = p1.x - p3.x; dy13 = p1.y - p3.y;
- X+ if (dx13==0 || dy13==0)
- X+ return(0);
- X s12 = asin((double)(dy12 / sqrt((double)(dx12*dx12 + dy12*dy12))));
- X s13 = asin((double)(dy13 / sqrt((double)(dx13*dx13 + dy13*dy13))));
- X if (fabs(s12 - s13) < .01) return(0);
- X*** @xfig.pl9/global.c Tue Jul 31 11:35:13 1990
- X--- ./global.c Fri Jun 14 10:16:35 1991
- X***************
- X*** 82,87 ****
- X--- 82,88 ----
- X int latexline_mode = 0;
- X int latexarrow_mode = 0;
- X int magnet_mode = 0;
- X+ int grid2_mode = 0;
- X int line_thickness = 1;
- X int line_style = SOLID_LINE;
- X int cur_radius = 7;
- X***************
- X*** 102,108 ****
- X float cur_dotgap = 3;
- X float cur_styleval = 0.0;
- X float cur_angle = 0.0;
- X! int cur_color = BLACK;
- X int cur_textstyle = PLAIN;
- X int cur_textjust = T_LEFT_JUSTIFIED;
- X /* line thicknesses for each gc */
- X--- 103,109 ----
- X float cur_dotgap = 3;
- X float cur_styleval = 0.0;
- X float cur_angle = 0.0;
- X! int cur_color = -1; /* default color to start */
- X int cur_textstyle = PLAIN;
- X int cur_textjust = T_LEFT_JUSTIFIED;
- X /* line thicknesses for each gc */
- X*** @xfig.pl9/glue.c Mon Apr 30 12:13:20 1990
- X--- ./glue.c Mon Jun 3 13:25:16 1991
- X***************
- X*** 14,20 ****
- X #include "object.h"
- X #include "paintop.h"
- X
- X- #define TOLERANCE 7
- X #define min(a, b) (((a) < (b)) ? (a) : (b))
- X #define max(a, b) (((a) > (b)) ? (a) : (b))
- X
- X--- 14,19 ----
- X***************
- X*** 368,374 ****
- X F_compound *c;
- X {
- X draw_compoundelements(c, background_color, background_color,
- X! ERASE, ERASE, INV_PAINT, ERASE);
- X }
- X
- X draw_compoundelements(c, arcop, ellipseop, lineop, splineop, textop, compop)
- X--- 367,373 ----
- X F_compound *c;
- X {
- X draw_compoundelements(c, background_color, background_color,
- X! ERASE, ERASE, ERASE, ERASE);
- X }
- X
- X draw_compoundelements(c, arcop, ellipseop, lineop, splineop, textop, compop)
- X*** @xfig.pl9/grid.c Mon Apr 16 11:25:54 1990
- X--- ./grid.c Mon Jun 3 11:14:02 1991
- X***************
- X*** 21,65 ****
- X #define null_height 32
- X static char null_bits[null_width * null_height / 8] = { 0 };
- X
- X! #define quarter_width 20
- X! #define quarter_height 20
- X! static char quarter_bits[] = {
- X! 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X! 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X! 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X! 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- X! 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x42, 0x08};
- X
- X- #define half_width 40
- X- #define half_height 40
- X- static char half_bits[] = {
- X- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X- 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X- 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X- 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X- 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X- 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X- 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
- X- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X- 0x00, 0x00, 0x00, 0x10, 0x42, 0x08, 0x21, 0x84};
- X-
- X- #define half_cm_width 15
- X- #define half_cm_height 15
- X- static char half_cm_bits[] = {
- X- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
- X- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00,
- X- 0x00, 0x00, 0x00, 0x00, 0x10, 0x42, 0x00, 0x00};
- X-
- X- static Pixmap null_pm, quarter_pm, half_pm, half_cm_pm;
- X-
- X init_grid()
- X {
- X unsigned long bg, fg;
- X--- 21,28 ----
- X #define null_height 32
- X static char null_bits[null_width * null_height / 8] = { 0 };
- X
- X! static Pixmap null_pm, grid_pm=0;
- X
- X init_grid()
- X {
- X unsigned long bg, fg;
- X***************
- X*** 72,111 ****
- X null_pm = XCreatePixmapFromBitmapData(tool_d, canvas_win,
- X null_bits, null_width, null_height,
- X fg, bg, DefaultDepthOfScreen(tool_s));
- X- quarter_pm = XCreatePixmapFromBitmapData(tool_d, canvas_win,
- X- quarter_bits, quarter_width, quarter_height,
- X- fg, bg, DefaultDepthOfScreen(tool_s));
- X- half_pm = XCreatePixmapFromBitmapData(tool_d, canvas_win,
- X- half_bits, half_width, half_height,
- X- fg, bg, DefaultDepthOfScreen(tool_s));
- X- half_cm_pm = XCreatePixmapFromBitmapData(tool_d, canvas_win,
- X- half_cm_bits, half_cm_width, half_cm_height,
- X- fg, bg, DefaultDepthOfScreen(tool_s));
- X }
- X
- X /* grid in X11 is simply the background of the canvas */
- X
- X setup_grid(grid)
- X! int grid;
- X {
- X! static Arg grid_args[] =
- X! {
- X! { XtNbackgroundPixmap, (XtArgVal)NULL },
- X! };
- X
- X if (grid == cur_grid)
- X {
- X grid_args[0].value = (XtArgVal)null_pm;
- X grid = -1;
- X }
- X! if( appres.INCHES )
- X! {
- X! if (grid == F_GRID1)
- X! grid_args[0].value = (XtArgVal)quarter_pm;
- X! else if (grid == F_GRID2)
- X! grid_args[0].value = (XtArgVal)half_pm;
- X! }else if (grid == F_GRID1 || grid == F_GRID2)
- X! grid_args[0].value = (XtArgVal)half_cm_pm;
- X cur_grid = grid;
- X XtSetValues(canvas_sw, grid_args, XtNumber(grid_args));
- X }
- X--- 35,116 ----
- X null_pm = XCreatePixmapFromBitmapData(tool_d, canvas_win,
- X null_bits, null_width, null_height,
- X fg, bg, DefaultDepthOfScreen(tool_s));
- X }
- X
- X /* grid in X11 is simply the background of the canvas */
- X
- X setup_grid(grid)
- X! int grid;
- X {
- X! int coarse,fine,x,y,x0c,y0c,x0f,y0f,dim;
- X! unsigned long bg, fg;
- X! static Arg grid_args[]={{XtNbackgroundPixmap, (XtArgVal)NULL},};
- X! Arg tmp_arg[3];
- X
- X+ XtSetArg(tmp_arg[0], XtNbackground, &bg);
- X+ XtSetArg(tmp_arg[1], XtNforeground, &fg);
- X+ XtGetValues(canvas_sw, tmp_arg, 2);
- X+
- X+ /* If there is a grid, the canvas will be redisplayed later on.
- X+ If there is no grid, redisplay the canvas here. */
- X+ if (grid==0 && cur_grid==-1)
- X+ { redisplay_canvas();
- X+ return;
- X+ }
- X if (grid == cur_grid)
- X {
- X grid_args[0].value = (XtArgVal)null_pm;
- X grid = -1;
- X }
- X! else
- X! { if (grid==0) grid=cur_grid; /* rezoom grid */
- X! if (appres.INCHES)
- X! if (grid==F_GRID1)
- X! { coarse=20*zoomscale;
- X! fine=5*zoomscale;
- X! }
- X! else
- X! { coarse=40*zoomscale;
- X! fine=5*zoomscale;
- X! }
- X! else
- X! if (grid==F_GRID1)
- X! { coarse=15*zoomscale;
- X! fine=3*zoomscale;
- X! }
- X! else
- X! { coarse=15*zoomscale;
- X! fine=0;
- X! }
- X! dim=(coarse>64)? coarse : (64/coarse+1)*coarse;
- X! if (grid_pm) XFreePixmap(tool_d,grid_pm);
- X! grid_pm=XCreatePixmap(tool_d,canvas_win,dim,dim,
- X! DefaultDepthOfScreen(tool_s));
- X! XSetForeground(tool_d,gc,bg);
- X! XFillRectangle(tool_d,grid_pm,gc,0,0,dim,dim);
- X! x0c= -(zoomscale*zoomxoff)%coarse-zoomscale;
- X! y0c= -(zoomscale*zoomyoff)%coarse-zoomscale;
- X! if (fine)
- X! { x0f= -(zoomscale*zoomxoff)%fine-zoomscale;
- X! y0f= -(zoomscale*zoomyoff)%fine-zoomscale;
- X! }
- X! XSetForeground(tool_d,gc,fg);
- X! if (fine)
- X! { for (x=x0c;x<dim;x+=coarse)
- X! for (y=y0f;y<dim;y+=fine)
- X! XDrawPoint(tool_d,grid_pm,gc,x,y);
- X! for (y=y0c;y<dim;y+=coarse)
- X! for (x=x0f;x<dim;x+=fine)
- X! XDrawPoint(tool_d,grid_pm,gc,x,y);
- X! }
- X! else
- X! { for (x=x0c;x<dim;x+=coarse)
- X! for (y=y0c;y<dim;y+=coarse)
- X! XDrawPoint(tool_d,grid_pm,gc,x,y);
- X! }
- X! grid_args[0].value = (XtArgVal)grid_pm;
- X!
- X! }
- X cur_grid = grid;
- X XtSetValues(canvas_sw, grid_args, XtNumber(grid_args));
- X }
- X*** @xfig.pl9/intspline.c Tue May 1 16:23:12 1990
- X--- ./intspline.c Mon Jun 3 13:25:16 1991
- X***************
- X*** 69,75 ****
- X draw_elasticline();
- X if (num_point <= 2) {
- X pw_vector(canvas_win, first_point->x, first_point->y,
- X! cur_point->x, cur_point->y, PAINT, 1, SOLID_LINE, 0.0);
- X if (num_point == 1) {
- X free((char*)cur_point);
- X cur_point = NULL;
- X--- 69,75 ----
- X draw_elasticline();
- X if (num_point <= 2) {
- X pw_vector(canvas_win, first_point->x, first_point->y,
- X! cur_point->x, cur_point->y, PAINT, 1, RUBBER_LINE, 0.0);
- X if (num_point == 1) {
- X free((char*)cur_point);
- X cur_point = NULL;
- X***************
- X*** 91,97 ****
- X }
- X spline->style = line_style;
- X spline->thickness = line_thickness;
- X! spline->style_val = cur_styleval;
- X spline->color = cur_color;
- X spline->depth = 0;
- X spline->area_fill = 0;
- X--- 91,97 ----
- X }
- X spline->style = line_style;
- X spline->thickness = line_thickness;
- X! spline->style_val = cur_styleval*(line_thickness+1)/2;
- X spline->color = cur_color;
- X spline->depth = 0;
- X spline->area_fill = 0;
- X***************
- X*** 228,242 ****
- X dx = x1 - x2;
- X dy = y2 - y1;
- X l1 = sqrt((double)(dx*dx + dy*dy));
- X! theta1 = atan2((double)dy, (double)dx);
- X dx = x3 - x2;
- X dy = y2 - y3;
- X l2 = sqrt((double)(dx*dx + dy*dy));
- X! theta2 = atan2((double)dy, (double)dx);
- X! /* -PI <= theat1, theta2 <= PI */
- X if (theta1 < 0) theta1 += _2xPI;
- X if (theta2 < 0) theta2 += _2xPI;
- X! /* 0 <= theat1, theta2 < 2PI */
- X
- X cp = controls->next;
- X control_points(x2, y2, l1, l2, theta1, theta2, T, cp);
- X--- 228,248 ----
- X dx = x1 - x2;
- X dy = y2 - y1;
- X l1 = sqrt((double)(dx*dx + dy*dy));
- X! if (l1==0.0)
- X! theta1 = 0.0;
- X! else
- X! theta1 = atan2((double)dy, (double)dx);
- X dx = x3 - x2;
- X dy = y2 - y3;
- X l2 = sqrt((double)(dx*dx + dy*dy));
- X! if (l2==0.0)
- X! theta2 = 0.0;
- X! else
- X! theta2 = atan2((double)dy, (double)dx);
- X! /* -PI <= theta1, theta2 <= PI */
- X if (theta1 < 0) theta1 += _2xPI;
- X if (theta2 < 0) theta2 += _2xPI;
- X! /* 0 <= theta1, theta2 < 2PI */
- X
- X cp = controls->next;
- X control_points(x2, y2, l1, l2, theta1, theta2, T, cp);
- X***************
- X*** 260,266 ****
- X dx = x3 - x2;
- X dy = y2 - y3;
- X l2 = sqrt((double)(dx*dx + dy*dy));
- X! theta2 = atan2((double)dy, (double)dx);
- X if (theta2 < 0) theta2 += _2xPI;
- X cp = cp->next;
- X control_points(x2, y2, l1, l2, theta1, theta2, T, cp);
- X--- 266,275 ----
- X dx = x3 - x2;
- X dy = y2 - y3;
- X l2 = sqrt((double)(dx*dx + dy*dy));
- X! if (l2==0.0)
- X! theta2 = 0.0;
- X! else
- X! theta2 = atan2((double)dy, (double)dx);
- X if (theta2 < 0) theta2 += _2xPI;
- X cp = cp->next;
- X control_points(x2, y2, l1, l2, theta1, theta2, T, cp);
- X***************
- X*** 296,302 ****
- X {
- X float s, theta, r = 1 - t;
- X
- X! /* 0 <= theat1, theta2 < 2PI */
- X
- X theta = (theta1 + theta2) / 2;
- X
- X--- 305,311 ----
- X {
- X float s, theta, r = 1 - t;
- X
- X! /* 0 <= theta1, theta2 < 2PI */
- X
- X theta = (theta1 + theta2) / 2;
- X
- X*** @xfig.pl9/line.c Mon Apr 30 12:13:27 1990
- X--- ./line.c Mon Jun 3 11:14:12 1991
- X***************
- X*** 13,18 ****
- X--- 13,19 ----
- X #include "func.h"
- X #include "object.h"
- X #include "paintop.h"
- X+ #include "zoom.h"
- X
- X extern (*canvas_kbd_proc)();
- X extern (*canvas_locmove_proc)();
- X***************
- X*** 29,34 ****
- X--- 30,37 ----
- X extern int manhattan_mode, mountain_mode;
- X extern int latexline_mode, latexarrow_mode;
- X extern int magnet_mode, latexarrow_mode;
- X+ extern int grid2_mode;
- X+ extern appresStruct appres;
- X extern int autoforwardarrow_mode, autobackwardarrow_mode;
- X extern int line_style, line_thickness;
- X extern float cur_styleval;
- X***************
- X*** 105,111 ****
- X draw_elasticline()
- X {
- X pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y,
- X! INV_PAINT, 1, SOLID_LINE, 0.0);
- X }
- X
- X freehand_elasticline(x, y)
- X--- 108,114 ----
- X draw_elasticline()
- X {
- X pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y,
- X! INV_PAINT, 1, RUBBER_LINE, 0.0);
- X }
- X
- X freehand_elasticline(x, y)
- X***************
- X*** 122,129 ****
- X int x, y;
- X CURSOR c;
- X
- X! latex_endpoint(fix_x, fix_y, cur_x, cur_y, &x, &y, latexarrow_mode, (magnet_mode)? 5: 1);
- X! pw_vector(canvas_win, fix_x, fix_y, x, y, INV_PAINT,1,SOLID_LINE, 0.0);
- X c = (x == cur_x && y == cur_y)? &null_cursor: &crosshair_cursor;
- X if (c != cur_cursor) {
- X set_temp_cursor(c);
- X--- 125,132 ----
- X int x, y;
- X CURSOR c;
- X
- X! latex_endpoint(fix_x, fix_y, cur_x, cur_y, &x, &y, latexarrow_mode, (magnet_mode)? (appres.INCHES? 5:(grid2_mode? 15:3)): 1);
- X! pw_vector(canvas_win, fix_x, fix_y, x, y, INV_PAINT,1,RUBBER_LINE, 0.0);
- X c = (x == cur_x && y == cur_y)? &null_cursor: &crosshair_cursor;
- X if (c != cur_cursor) {
- X set_temp_cursor(c);
- X***************
- X*** 144,152 ****
- X int x, y;
- X {
- X if (x == cur_x && y == cur_y) return;
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,SOLID_LINE, 0.0);
- X cur_x = x;
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,SOLID_LINE, 0.0);
- X win_setmouseposition(canvas_win, cur_x, cur_y);
- X }
- X
- X--- 147,155 ----
- X int x, y;
- X {
- X if (x == cur_x && y == cur_y) return;
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,RUBBER_LINE, 0.0);
- X cur_x = x;
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,RUBBER_LINE, 0.0);
- X win_setmouseposition(canvas_win, cur_x, cur_y);
- X }
- X
- X***************
- X*** 154,162 ****
- X int x, y;
- X {
- X if (x == cur_x && y == cur_y) return;
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,SOLID_LINE, 0.0);
- X cur_y = y;
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,SOLID_LINE, 0.0);
- X win_setmouseposition(canvas_win, cur_x, cur_y);
- X }
- X
- X--- 157,165 ----
- X int x, y;
- X {
- X if (x == cur_x && y == cur_y) return;
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,RUBBER_LINE, 0.0);
- X cur_y = y;
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,RUBBER_LINE, 0.0);
- X win_setmouseposition(canvas_win, cur_x, cur_y);
- X }
- X
- X***************
- X*** 164,170 ****
- X int x, y;
- X {
- X if (x == cur_x && y == cur_y) return;
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,SOLID_LINE, 0.0);
- X if (abs(x - cur_x) < abs(y - cur_y)) {
- X cur_x += cur_y - y;
- X cur_y = y;
- X--- 167,173 ----
- X int x, y;
- X {
- X if (x == cur_x && y == cur_y) return;
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,RUBBER_LINE, 0.0);
- X if (abs(x - cur_x) < abs(y - cur_y)) {
- X cur_x += cur_y - y;
- X cur_y = y;
- X***************
- X*** 173,179 ****
- X cur_y -= x - cur_x;
- X cur_x = x;
- X }
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,SOLID_LINE, 0.0);
- X win_setmouseposition(canvas_win, cur_x, cur_y);
- X }
- X
- X--- 176,182 ----
- X cur_y -= x - cur_x;
- X cur_x = x;
- X }
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,RUBBER_LINE, 0.0);
- X win_setmouseposition(canvas_win, cur_x, cur_y);
- X }
- X
- X***************
- X*** 181,187 ****
- X int x, y;
- X {
- X if (x == cur_x && y == cur_y) return;
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,SOLID_LINE, 0.0);
- X if (abs(x - cur_x) < abs(y - cur_y)) {
- X cur_x += y - cur_y;
- X cur_y = y;
- X--- 184,190 ----
- X int x, y;
- X {
- X if (x == cur_x && y == cur_y) return;
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,RUBBER_LINE, 0.0);
- X if (abs(x - cur_x) < abs(y - cur_y)) {
- X cur_x += y - cur_y;
- X cur_y = y;
- X***************
- X*** 190,196 ****
- X cur_y += x - cur_x;
- X cur_x = x;
- X }
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,SOLID_LINE, 0.0);
- X win_setmouseposition(canvas_win, cur_x, cur_y);
- X }
- X
- X--- 193,199 ----
- X cur_y += x - cur_x;
- X cur_x = x;
- X }
- X! pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,RUBBER_LINE, 0.0);
- X win_setmouseposition(canvas_win, cur_x, cur_y);
- X }
- X
- X***************
- X*** 240,246 ****
- X int x, y;
- X {
- X draw_latexline();
- X! latex_endpoint(fix_x, fix_y, x, y, &cur_x, &cur_y, latexarrow_mode, (magnet_mode)? 5: 1);
- X if (cur_cursor != &null_cursor) {
- X set_temp_cursor(&null_cursor);
- X cur_cursor = &null_cursor;
- X--- 243,249 ----
- X int x, y;
- X {
- X draw_latexline();
- X! latex_endpoint(fix_x, fix_y, x, y, &cur_x, &cur_y, latexarrow_mode, (magnet_mode)? (appres.INCHES? 5:(grid2_mode? 15:3)): 1);
- X if (cur_cursor != &null_cursor) {
- X set_temp_cursor(&null_cursor);
- X cur_cursor = &null_cursor;
- X***************
- X*** 268,274 ****
- X {
- X if (x != fix_x || y != fix_y || num_point == 1) {
- X draw_latexline();
- X! latex_endpoint(fix_x, fix_y, x, y, &cur_x, &cur_y, latexarrow_mode, (magnet_mode)? 5: 1);
- X if (cur_cursor != &null_cursor) {
- X set_temp_cursor(&null_cursor);
- X cur_cursor = &null_cursor;
- X--- 271,277 ----
- X {
- X if (x != fix_x || y != fix_y || num_point == 1) {
- X draw_latexline();
- X! latex_endpoint(fix_x, fix_y, x, y, &cur_x, &cur_y, latexarrow_mode, (magnet_mode)? (appres.INCHES? 5:(grid2_mode? 15:3)): 1);
- X if (cur_cursor != &null_cursor) {
- X set_temp_cursor(&null_cursor);
- X cur_cursor = &null_cursor;
- X***************
- X*** 355,360 ****
- X--- 358,364 ----
- X if (!dot)
- X {
- X line->thickness = 1;
- X+ line->style = RUBBER_LINE;
- X line->area_fill = 0;
- X draw_line(line,INV_PAINT); /* erase temporary outline */
- X line->thickness = line_thickness;
- X***************
- X*** 361,367 ****
- X line->area_fill = fill_mode? cur_areafill : 0;
- X line->thickness = line_thickness;
- X line->style = line_style;
- X! line->style_val = cur_styleval;
- X draw_line(line,PAINT); /* draw final */
- X }
- X clean_up();
- X--- 365,371 ----
- X line->area_fill = fill_mode? cur_areafill : 0;
- X line->thickness = line_thickness;
- X line->style = line_style;
- X! line->style_val = cur_styleval*(line_thickness+1)/2;
- X draw_line(line,PAINT); /* draw final */
- X }
- X clean_up();
- X***************
- X*** 399,405 ****
- X--- 403,412 ----
- X XPoint *points;
- X GC gc;
- X
- X+ /*
- X if (line->area_fill <= 0 || line->type == T_POLYLINE)
- X+ */
- X+ if (line->area_fill <= 0)
- X return;
- X
- X if (op == PAINT) /* fill */
- X***************
- X*** 426,432 ****
- X points[i].x = pnt->x;
- X points[i].y = pnt->y;
- X }
- X! XFillPolygon(tool_d,canvas_win,gc,points, npts,
- X Complex, CoordModeOrigin);
- X free(points);
- X }
- X--- 433,439 ----
- X points[i].x = pnt->x;
- X points[i].y = pnt->y;
- X }
- X! zXFillPolygon(tool_d,canvas_win,gc,points, npts,
- X Complex, CoordModeOrigin);
- X free(points);
- X }
- X***************
- X*** 459,485 ****
- X
- X diam = 2*radius;
- X /* upper left */
- X! XFillArc(tool_d, canvas_win, gc, xmin, ymin,
- X diam, diam, 90*64, 90*64);
- X /* lower left */
- X! XFillArc(tool_d, canvas_win, gc, xmin, ymax-diam,
- X diam, diam, 180*64, 90*64);
- X /* lower right */
- X! XFillArc(tool_d, canvas_win, gc, xmax-diam, ymax-diam,
- X diam, diam, 270*64, 90*64);
- X /* upper right */
- X! XFillArc(tool_d, canvas_win, gc, xmax-diam, ymin,
- X diam, diam, 0*64, 90*64);
- X /* fill strip on left side between upper and lower arcs */
- X if (ymax-ymin-diam > 0)
- X! XFillRectangle(tool_d, canvas_win, gc, xmin, ymin+radius,
- X radius, ymax-ymin-diam);
- X /* fill middle section */
- X if (xmax-xmin-diam > 0)
- X! XFillRectangle(tool_d, canvas_win, gc, xmin+radius, ymin,
- X xmax-xmin-diam, ymax-ymin);
- X /* fill strip on right side between upper and lower arcs */
- X if (ymax-ymin-diam > 0)
- X! XFillRectangle(tool_d, canvas_win, gc, xmax-radius, ymin+radius,
- X radius, ymax-ymin-diam);
- X }
- X--- 466,492 ----
- X
- X diam = 2*radius;
- X /* upper left */
- X! zXFillArc(tool_d, canvas_win, gc, xmin, ymin,
- X diam, diam, 90*64, 90*64);
- X /* lower left */
- X! zXFillArc(tool_d, canvas_win, gc, xmin, ymax-diam,
- X diam, diam, 180*64, 90*64);
- X /* lower right */
- X! zXFillArc(tool_d, canvas_win, gc, xmax-diam, ymax-diam,
- X diam, diam, 270*64, 90*64);
- X /* upper right */
- X! zXFillArc(tool_d, canvas_win, gc, xmax-diam, ymin,
- X diam, diam, 0*64, 90*64);
- X /* fill strip on left side between upper and lower arcs */
- X if (ymax-ymin-diam > 0)
- X! zXFillRectangle(tool_d, canvas_win, gc, xmin, ymin+radius,
- X radius, ymax-ymin-diam);
- X /* fill middle section */
- X if (xmax-xmin-diam > 0)
- X! zXFillRectangle(tool_d, canvas_win, gc, xmin+radius, ymin,
- X xmax-xmin-diam, ymax-ymin);
- X /* fill strip on right side between upper and lower arcs */
- X if (ymax-ymin-diam > 0)
- X! zXFillRectangle(tool_d, canvas_win, gc, xmax-radius, ymin+radius,
- X radius, ymax-ymin-diam);
- X }
- X*** @xfig.pl9/main.c Thu Sep 20 16:21:20 1990
- X--- ./main.c Mon Jun 3 11:14:17 1991
- X***************
- X*** 1,3 ****
- X--- 1,4 ----
- X+ /* changes by ges to introduce startFontSize */
- X /*
- X * FIG : Facility for Interactive Generation of figures
- X *
- X***************
- X*** 66,71 ****
- X--- 67,74 ----
- X XtOffset(appresPtr, boldFont), XtRString, (caddr_t)NULL},
- X {"normalFont", "NormalFont", XtRString, sizeof(char *),
- X XtOffset(appresPtr, normalFont), XtRString, (caddr_t)NULL},
- X+ {"startfontsize", "StartFontSize", XtRFloat, sizeof(float),
- X+ XtOffset(appresPtr, startfontsize), XtRInt, (caddr_t)&zero},
- X };
- X
- X static XrmOptionDescRec options[] =
- X***************
- X*** 88,93 ****
- X--- 91,98 ----
- X {"-metric", ".inches", XrmoptionNoArg, "False"},
- X {"-boldFont", ".boldFont", XrmoptionSepArg, 0},
- X {"-normalFont", ".normalFont", XrmoptionSepArg, 0},
- X+ {"-startFontSize", ".startfontsize", XrmoptionSepArg, 0},
- X+ {"-startfontsize", ".startfontsize", XrmoptionSepArg, 0},
- X };
- X
- X static XtCallbackRec callbacks[] =
- X***************
- X*** 122,135 ****
- X sprintf(tstr,"%d",PATCHLEVEL);
- X strcat(tool_name, tstr);
- X strcat(file_header, PROTOCOL_VERSION);
- X- printf("Initializing FIG v%s Protocol v%s (X11 patchlevel %d) ... \n",
- X- FIG_VERSION, PROTOCOL_VERSION, PATCHLEVEL);
- X tool = XtInitialize("fig", "Fig", options, XtNumber(options),
- X (Cardinal *)&argc, argv);
- X
- X fix_converters();
- X XtGetApplicationResources(tool, &appres, application_resources,
- X! 10, NULL, 0 );
- X
- X i=1;
- X while (argc-- > 1)
- X--- 127,138 ----
- X sprintf(tstr,"%d",PATCHLEVEL);
- X strcat(tool_name, tstr);
- X strcat(file_header, PROTOCOL_VERSION);
- X tool = XtInitialize("fig", "Fig", options, XtNumber(options),
- X (Cardinal *)&argc, argv);
- X
- X fix_converters();
- X XtGetApplicationResources(tool, &appres, application_resources,
- X! XtNumber(application_resources), NULL, 0 );
- X
- X i=1;
- X while (argc-- > 1)
- X***************
- X*** 199,204 ****
- X--- 202,209 ----
- X form = XtCreateManagedWidget("form", formWidgetClass, tool,
- X form_args, XtNumber(form_args));
- X
- X+ if (size_button == 0)
- X+ size_button = (int) appres.startfontsize;
- X if (size_button == 0)
- X size_button = DEF_PRINTFONTSIZE;
- X
- X*** @xfig.pl9/move.c Mon Apr 30 12:13:29 1990
- X--- ./move.c Mon Jun 3 11:14:22 1991
- X***************
- X*** 13,20 ****
- X #include "func.h"
- X #include "object.h"
- X #include "paintop.h"
- X
- X- #define TOLERANCE 3
- X
- X extern (*canvas_kbd_proc)();
- X extern (*canvas_locmove_proc)();
- X--- 13,20 ----
- X #include "func.h"
- X #include "object.h"
- X #include "paintop.h"
- X+ #include "zoom.h"
- X
- X
- X extern (*canvas_kbd_proc)();
- X extern (*canvas_locmove_proc)();
- X***************
- X*** 25,37 ****
- X extern null_proc();
- X extern set_popupmenu();
- X
- X- extern F_line *line_search();
- X- extern F_arc *arc_search();
- X- extern F_ellipse *ellipse_search();
- X- extern F_text *text_search();
- X- extern F_spline *spline_search();
- X- extern F_compound *compound_search();
- X-
- X extern int foreground_color, background_color;
- X extern int pointmarker_shown, compoundbox_shown;
- X extern int last_object;
- X--- 25,30 ----
- X***************
- X*** 38,49 ****
- X extern int last_action;
- X
- X extern int init_move();
- X
- X move_selected()
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! canvas_leftbut_proc = init_move;
- X canvas_middlebut_proc = null_proc;
- X canvas_rightbut_proc = set_popupmenu;
- X return_proc = move_selected;
- X--- 31,44 ----
- X extern int last_action;
- X
- X extern int init_move();
- X+ extern int object_search();
- X
- X move_selected()
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! init_object_search(init_move);
- X! canvas_leftbut_proc = object_search /*init_move*/;
- X canvas_middlebut_proc = null_proc;
- X canvas_rightbut_proc = set_popupmenu;
- X return_proc = move_selected;
- X***************
- X*** 51,58 ****
- X reset_action_on();
- X }
- X
- X! init_move(x, y)
- X! int x, y;
- X {
- X F_line *l;
- X F_arc *a;
- X--- 46,55 ----
- X reset_action_on();
- X }
- X
- X! init_move(p,type,x,y,px,py)
- X! char *p;
- X! int type;
- X! int px,py;
- X {
- X F_line *l;
- X F_arc *a;
- X***************
- X*** 60,69 ****
- X F_text *t;
- X F_spline *s;
- X F_compound *c;
- X- int px, py;
- X PR_SIZE size;
- X
- X! if ((c = compound_search(x, y, TOLERANCE, &px, &py)) != NULL) {
- X set_temp_cursor(&wait_cursor);
- X win_setmouseposition(canvas_win, px, py);
- X if (compoundbox_shown) draw_compoundbox(c, INV_PAINT);
- X--- 57,67 ----
- X F_text *t;
- X F_spline *s;
- X F_compound *c;
- X PR_SIZE size;
- X
- X! switch(type)
- X! { case O_COMPOUND:
- X! c=(F_compound *) p;
- X set_temp_cursor(&wait_cursor);
- X win_setmouseposition(canvas_win, px, py);
- X if (compoundbox_shown) draw_compoundbox(c, INV_PAINT);
- X***************
- X*** 73,80 ****
- X clean_up();
- X set_action_object(F_MOVE, O_COMPOUND);
- X set_latestcompound(c);
- X! }
- X! else if ((l = line_search(x, y, TOLERANCE, &px, &py)) != NULL) {
- X set_temp_cursor(&wait_cursor);
- X erase_pointmarker();
- X win_setmouseposition(canvas_win, px, py);
- X--- 71,79 ----
- X clean_up();
- X set_action_object(F_MOVE, O_COMPOUND);
- X set_latestcompound(c);
- X! break;
- X! case O_POLYLINE:
- X! l=(F_line *) p;
- X set_temp_cursor(&wait_cursor);
- X erase_pointmarker();
- X win_setmouseposition(canvas_win, px, py);
- X***************
- X*** 84,91 ****
- X clean_up();
- X set_action_object(F_MOVE, O_POLYLINE);
- X set_latestline(l);
- X! }
- X! else if ((t = text_search(x, y)) != NULL) {
- X set_temp_cursor(&wait_cursor);
- X erase_pointmarker();
- X px = 0;
- X--- 83,91 ----
- X clean_up();
- X set_action_object(F_MOVE, O_POLYLINE);
- X set_latestline(l);
- X! break;
- X! case O_TEXT:
- X! t=(F_text *) p;
- X set_temp_cursor(&wait_cursor);
- X erase_pointmarker();
- X px = 0;
- X***************
- X*** 93,103 ****
- X {
- X size = pf_textwidth(t->font, t->size, strlen(t->cstring), t->cstring);
- X if (t->type == T_CENTER_JUSTIFIED)
- X! px = size.x/2;
- X else
- X! px = size.x;
- X }
- X! pw_text(canvas_win, t->base_x - px, t->base_y, INV_PAINT,
- X t->font, t->size, t->cstring);
- X init_textdragging(t, x, y);
- X set_temp_cursor(&null_cursor);
- X--- 93,103 ----
- X {
- X size = pf_textwidth(t->font, t->size, strlen(t->cstring), t->cstring);
- X if (t->type == T_CENTER_JUSTIFIED)
- X! px = size.x/2/zoomscale;
- X else
- X! px = size.x/zoomscale;
- X }
- X! pw_text(canvas_win, t->base_x - px, t->base_y, ERASE,
- X t->font, t->size, t->cstring);
- X init_textdragging(t, x, y);
- X set_temp_cursor(&null_cursor);
- X***************
- X*** 104,111 ****
- X clean_up();
- X set_action_object(F_MOVE, O_TEXT);
- X set_latesttext(t);
- X! }
- X! else if ((e = ellipse_search(x, y, TOLERANCE, &px, &py)) != NULL) {
- X set_temp_cursor(&wait_cursor);
- X erase_pointmarker();
- X set_temp_cursor(&null_cursor);
- X--- 104,112 ----
- X clean_up();
- X set_action_object(F_MOVE, O_TEXT);
- X set_latesttext(t);
- X! break;
- X! case O_ELLIPSE:
- X! e=(F_ellipse *) p;
- X set_temp_cursor(&wait_cursor);
- X erase_pointmarker();
- X set_temp_cursor(&null_cursor);
- X***************
- X*** 116,123 ****
- X clean_up();
- X set_action_object(F_MOVE, O_ELLIPSE);
- X set_latestellipse(e);
- X! }
- X! else if ((a = arc_search(x, y, TOLERANCE, &px, &py)) != NULL) {
- X set_temp_cursor(&wait_cursor);
- X erase_pointmarker();
- X win_setmouseposition(canvas_win, px, py);
- X--- 117,125 ----
- X clean_up();
- X set_action_object(F_MOVE, O_ELLIPSE);
- X set_latestellipse(e);
- X! break;
- X! case O_ARC:
- X! a=(F_arc *) p;
- X set_temp_cursor(&wait_cursor);
- X erase_pointmarker();
- X win_setmouseposition(canvas_win, px, py);
- X***************
- X*** 127,134 ****
- X clean_up();
- X set_action_object(F_MOVE, O_ARC);
- X set_latestarc(a);
- X! }
- X! else if ((s = spline_search(x, y, TOLERANCE, &px, &py)) != NULL) {
- X set_temp_cursor(&wait_cursor);
- X win_setmouseposition(canvas_win, px, py);
- X erase_pointmarker();
- X--- 129,137 ----
- X clean_up();
- X set_action_object(F_MOVE, O_ARC);
- X set_latestarc(a);
- X! break;
- X! case O_SPLINE:
- X! s= (F_spline *) p;
- X set_temp_cursor(&wait_cursor);
- X win_setmouseposition(canvas_win, px, py);
- X erase_pointmarker();
- X***************
- X*** 138,145 ****
- X clean_up();
- X set_action_object(F_MOVE, O_SPLINE);
- X set_latestspline(s);
- X! }
- X! else
- X return;
- X- canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
- X }
- X--- 141,149 ----
- X clean_up();
- X set_action_object(F_MOVE, O_SPLINE);
- X set_latestspline(s);
- X! break;
- X! default:
- X return;
- X }
- X+ canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
- X+ }
- END_OF_FILE
- if test 48592 -ne `wc -c <'patch10.2'`; then
- echo shar: \"'patch10.2'\" unpacked with wrong size!
- fi
- # end of 'patch10.2'
- fi
- echo shar: End of archive 1 \(of 4\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 3 4 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 4 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
- --
- Dan Heller
- O'Reilly && Associates Z-Code Software Comp-sources-x:
- Senior Writer President comp-sources-x@uunet.uu.net
- argv@ora.com argv@zipcode.com
-